
{{ define "editLabel" }}
	<div id="lbl{{.UID}}">
		<form method="post" action="update">
			<input type="hidden" name="type" value="Label" />

			<label for="lblUID">UID</label>
			<input id="lblUID" type="text" name="UID" value="{{ .UID }}" readonly="readonly" />
			<br />

			<label for="lblItem">Belongs to</label>
			<input id="lblItem" type="text" name="Item" value="{{ .Item }}" readonly="readonly" />
			<br />

			<label for="lblName">Name</label>
			<input id="lblName" type="text" name="Name" value="{{ .Name }}" />
			<br />

			<label for="lblSlug">Slug</label>
			<input id="lblSlug" type="text" name="Slug" value="{{ .Slug }}" />
			<br />

			<label for="lblDesc">Description</label>
			<textarea id="lblDesc" name="Desc">{{ .Desc }}</textarea>
			<br />

			<input type="submit" value="Update" />
		</form>
	</div>
{{ end }}

{{ define "editField" }}
	<div id="fld{{.UID}}">
		<form method="post" action="update">
			<input type="hidden" name="type" value="Field" />

			<label for="fldUID">UID</label>
			<input id="fldUID" type="text" name="UID" value="{{ .UID }}" readonly="readonly" />
			<br />

			<label for="fldNode">Belongs to</label>
			<input id="fldNode" type="text" name="Node" value="{{ .Node }}" readonly="readonly" />
			<br />

			<p>Label</p>
			{{ template "viewLabel" getLabel .Label }}
			<br />

			<label for="fldValue">Value</label>
			<textarea id="fldValue" name="Value">{{ .Value }}</textarea>
			<br />

			<label for="fldMod">Last modified</label>
			<input id="fldMod" type="text" name="Modified" value="{{ .Modified }}" readonly="readonly" />
			<br />

			<fieldset>
				<!-- BUG don't think the checked state will work -->
				<label for="fldInhLbl">Label is inheritable</label>
				<input id="fldInhLbl" type="checkbox" name="InhLabel" checked="{{ .InhLabel }}" />

				<label for="fldInhVal">Value is inheritable</label>
				<input id="fldInhVal" type="checkbox" name="InhValue" checked="{{ .InhValue }}" />

				<label for="fldValStc">Value is static</label>
				<input id="fldValStc" type="checkbox" name="InhStatic" checked="{{ .InhStatic }}" />
			</fieldset>
			<br />

			<input type="submit" value="Update" />
		</form>
	</div>
{{ end }}
